//
// Created by mouse on 2019/11/12.
//

#include "app_mqtt.h"

MQTTClient mqttClient;

void mqtt_connect(const char *username, const char *password)
{
    char id[32];
    sprintf(id, "nodemcu-%s", String(ESP.getChipId()).c_str());
    while (!mqttClient.connect(id, username, password))
    {
        Serial.print(".");
        delay(1000);
    }
    Serial.println("mqtt is connected");
}
